// axios
import request from '@/utils/request'

// 分类类别接口
export function getClassifyPort() {
  return request({
    url: 'courseClassify',
    method: 'GET'
  })
}

// 获取页面内容
export function getListDataPort(page, limit) {
  return request({
    url: `/courseBasis?page=${page}&limit=${limit}`,
    method: 'GET'
  })
}

// 获取分类内容
export function getClassifyDataPort(page = 1, limit = 10, course_type = 0, classify_id = 0, order_by = 0, attr_val_id = 0, is_vip = 0) {
  return request({
    url: `/courseBasis?page=${page}&limit=${limit}&course_type=${course_type}&classify_id=${classify_id}&order_by=${order_by}&attr_val_id=${attr_val_id}&is_vip=${is_vip}`,
    method: 'GET'
  })
}
// 获取分类内容
export function getClassifyDatasPort(params) {
  return request({
    url: '/courseBasis',
    method: 'GET',
    params
  })
}
// 获取课程详情
export function getCoursePort(iid) {
  return request({
    url: `courseInfo/basis_id=${iid}?`,
    method: 'GET'
  })
}
// 获取搜索页面内容
export function getSearchPort(limit, page, course_type, query) {
  return request({
    url: `/courseBasis?page=${page}&limit=${limit}&course_type=${course_type}&keywords=${query}`,
    method: 'GET'
  })
}
